import { Module, forwardRef } from '@nestjs/common';
import { MenuService } from './menu.service';
import { MenuController } from './menu.controller';
import { PassportModule } from '@nestjs/passport';
import { TypeOrmModule } from '@nestjs/typeorm';
import { CommonModule } from '../../common/common.module';
import { AuthModule } from '../../core/auth/auth.module';
import { Menu } from '../../entities/menu.entity';

@Module({
  imports: [
    TypeOrmModule.forFeature([Menu]),
    forwardRef(() => AuthModule), // 处理相互循环依赖
    CommonModule,
    PassportModule,
  ],
  controllers: [MenuController],
  providers: [MenuService],
  exports: [MenuService],
})
export class MenuModule {}
